﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainSite.Master" AutoEventWireup="true"
    CodeBehind="FlightInfo.aspx.cs" Inherits="Garlic.BasicInfo.FlightInfo" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Src="../UserControls/ServiceRouteTree.ascx" TagName="ServiceRouteTree"
    TagPrefix="uc1" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1.Export, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxClasses" TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="/Javascript/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <style type="text/css">
        .editdiv
        {
            padding: 5px;
        }
        .editdiv table
        {
            width: 100%;
        }
        .editdiv table td
        {
            padding: 5px;
        }
    </style>

     <script type="text/javascript">
    // <![CDATA[
         function OnChanged(cmb) {
             gridFlightInfo.GetEditor("SLN_NAME").PerformCallback(cmb.GetValue().toString());
         }

         function OnChanged1(cmb) {
             gridFlightInfo.GetEditor("CST_CSTMCD").PerformCallback(cmb.GetValue().toString());
         }

   
    // ]]>
       
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="operat_box">
        <div class="operate_div">
            <table class="form_tb">
                <tr>
                    <td>
                        船代理：
                    </td>
                    <td>
                        <asp:TextBox ID="txtCst_cstmnm" class="text" runat="server"></asp:TextBox>
                        <asp:HiddenField ID="hidCst_id" runat="server" />
                    </td>
                    <td>
                        服务航线：
                    </td>
                    <td>
                        <uc1:ServiceRouteTree ID="ServiceRouteTree1" CssClass="text" runat="server" />
                        <div style="display: none">
                            <asp:Button ID="btnFlt_schdul" runat="server" Text="Button" OnClick="btnFlt_schdul_Click" />
                        </div>
                        <script type="text/javascript">
                            function onFlt_schdulclick() {
                                document.getElementById("<%=btnFlt_schdul.ClientID %>").click();
                            }
                        </script>
                    </td>
                    <td>
                        预分码头：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlFlt_schdul" class="text" runat="server" AutoPostBack="false"
                            OnSelectedIndexChanged="ddlFlt_schdul_SelectedIndexChanged">
                        </asp:DropDownList>
                       
                    </td>
                    <td>
                        <asp:Button ID="ButtonSubmit" runat="server" Text=" 查 询 " OnClick="ButtonSubmit_Click"
                            Width="125px" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <dx:ASPxGridView ID="gridFlightInfo" ClientInstanceName="gridFlightInfo"  runat="server" AutoGenerateColumns="False" KeyFieldName="FLT_ID"
        Width="100%" OnRowDeleting="gridFlightInfo_RowDeleting" OnRowInserting="gridFlightInfo_RowInserting"
        OnRowUpdating="gridFlightInfo_RowUpdating" OnStartRowEditing="gridFlightInfo_StartRowEditing"
        OnCellEditorInitialize="gridFlightInfo_CellEditorInitialize">
        <Columns>
            <dx:GridViewCommandColumn VisibleIndex="0">
                <NewButton  Visible="True">
                </NewButton>
                <EditButton Text="编辑" Visible="True">
                </EditButton>
                <DeleteButton Text="删除" Visible="True">
                </DeleteButton>
            </dx:GridViewCommandColumn>
            <%--<dx:GridViewDataTextColumn FieldName="FLT_SLN_ID" VisibleIndex="0"  Caption="服务航线ID">
            </dx:GridViewDataTextColumn>--%>
            <dx:GridViewDataComboBoxColumn Caption="航线1" Visible="false" FieldName="SRT_RTCHNNM">
                <EditFormSettings Visible="True" VisibleIndex="1" />
                <PropertiesComboBox TextField="SRT_RTCHNNM" ValueField="SRT_ID" EnableSynchronization="False"
                    IncrementalFilteringMode="StartsWith">
                    <ClientSideEvents  EndCallback="function(s, e) { OnChanged(s); }" SelectedIndexChanged="function(s, e) { OnChanged(s); }"></ClientSideEvents>
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataComboBoxColumn Caption="服务航线" Visible="true"  FieldName="SLN_NAME">
              <EditFormSettings Visible="True" VisibleIndex="2" />
                <PropertiesComboBox ValueField="SLN_ID" EnableSynchronization="False"
                    IncrementalFilteringMode="StartsWith">
                    <ClientSideEvents EndCallback="function(s, e) { OnChanged1(s); }" SelectedIndexChanged="function(s, e) { OnChanged1(s); }"></ClientSideEvents>
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>

            <dx:GridViewDataComboBoxColumn Caption="预分码头" Visible="true"  FieldName="CST_CSTMCD">
            
            </dx:GridViewDataComboBoxColumn>
           <%-- <dx:GridViewDataTextColumn FieldName="SLN_NAME" VisibleIndex="3" Caption="服务航线">
              <EditFormSettings Visible="false"  VisibleIndex="3" />
            </dx:GridViewDataTextColumn>--%>
            <dx:GridViewDataTextColumn   FieldName="FLT_NO" VisibleIndex="4" Caption="航班号">
            <EditFormSettings  Visible="False"/>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataComboBoxColumn FieldName="FLT_SCHDUL" VisibleIndex="5" Caption="班期">
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn FieldName="FLT_CYCLE" VisibleIndex="6" Caption="周期">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataDateColumn FieldName="FLT_INITDT" VisibleIndex="7" Caption="月初始日期">
            </dx:GridViewDataDateColumn>
            <dx:GridViewDataTextColumn FieldName="FLT_DOCKHOUR" VisibleIndex="8" Caption="在港时间">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="FLT_IAMOUNT" VisibleIndex="9" Caption="进口箱量">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="FLT_EAMOUNT" VisibleIndex="10" Caption="出口箱量">
            </dx:GridViewDataTextColumn>

            <dx:GridViewDataTextColumn  FieldName="SLN_ID" Visible="false"></dx:GridViewDataTextColumn>
        </Columns>
        <%--  <Templates>
            <EditForm>
                <div class="editdiv">
               <dx:ASPxGridViewTemplateReplacement ID="Editors" ReplacementType="EditFormEditors" runat="server"></dx:ASPxGridViewTemplateReplacement>--%>
        <%--  <table class="dxgvEditFormTable">
                        <tr>
                            <td>
                                航班班期:
                            </td>
                            <td>
                               <asp:TextBox ID="txtFlt_schdul" Text='<%# Bind("FLT_SCHDUL") %>'  runat="server"></asp:TextBox>
                            </td>
                            <td>
                              在港时间:
                            </td>
                            <td>
                                <asp:TextBox ID="txtFlt_dockhour" Text='<%# Bind("FLT_DOCKHOUR") %>'  runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                               周期:
                            </td>
                            <td>
                                <asp:TextBox ID="txtFlt_cycle" Text='<%# Bind("FLT_CYCLE") %>'  runat="server"></asp:TextBox>
                             
                            </td>
                            <td>
                                月初始日期: 
                            </td>
                            <td>
                                <dx:ASPxDateEdit ID="txtFlt_initdt" Text='<%# Bind("FLT_INITDTSTR") %>' runat="server"> </dx:ASPxDateEdit>
                               
                            </td>
                        </tr>
                        <tr>
                            <td>
                                进口箱量:
                            </td>
                            <td>
                                <asp:TextBox ID="txtFlt_iamount" Text='<%# Bind("FLT_IAMOUNT") %>'  runat="server"></asp:TextBox>
                               
                            </td>
                            <td>
                                出口箱量:
                            </td>
                            <td>
                                <asp:TextBox ID="txtFlt_eamount" Text='<%# Bind("FLT_EAMOUNT") %>'  runat="server"></asp:TextBox>
                              
                            </td>
                        </tr>
                    </table>


                </div>
                <div style="text-align: right; padding: 5px">
                        <dx:ASPxGridViewTemplateReplacement ID="UpdateButton"  ReplacementType="EditFormUpdateButton" 
                            runat="server"></dx:ASPxGridViewTemplateReplacement>
                        <dx:ASPxGridViewTemplateReplacement ID="CancelButton" ReplacementType="EditFormCancelButton"
                            runat="server"></dx:ASPxGridViewTemplateReplacement>
                </div>
            </EditForm>
        </Templates>--%>
    </dx:ASPxGridView>
    <%--<dx:GridViewDataTextColumn FieldName="FLT_SLN_ID" VisibleIndex="0"  Caption="服务航线ID">
            </dx:GridViewDataTextColumn>--%>

            <input type="hidden" runat="server" id="hiddenSlnName" />
             <input type="hidden" runat="server" id="hdnCSTM" />
</asp:Content>
